package com.cskaoyan.javase.stringbuffer;

/**
 * @description: 字符串+号拼接底层是用可变字符串的append方法
 * @author: wuguidong@cskaoyan.onaliyun.com
 **/

public class Demo4 {
    public static void main(String[] args) {
        StringBuilder sb = new StringBuilder("abc");

        String s = "abc";
        String s2 = null;
        String result = s + s2;
        System.out.println(result);
    }
}
class A{
    int age;

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("A{");
        sb.append("age=").append(age);
        sb.append('}');
        return sb.toString();
    }
}